#ifndef __STDMYSTRING_H_
#define __STDMYSTRING_H_
#include <iostream>

#define Max_cin 1024*1024
class StdMyString
{
    friend std::ostream &operator<<(std::ostream &out, const StdMyString &str);
    friend std::istream &operator>>(std::istream &in, StdMyString &str);
    
private:
    int len;
    int size;
    char *str;

public:
    StdMyString();
    explicit StdMyString(const char *str);
    StdMyString(const StdMyString &str);
    ~StdMyString();

    bool operator<(const char *str);
    bool operator<(const StdMyString &str);
    bool operator>(const char *str);
    bool operator>(const StdMyString &str);
    bool operator!=(const char *str);
    bool operator==(const char *str);
    bool operator==(const StdMyString &str);
    bool operator!=(const StdMyString &str);

    StdMyString GetString(int start,int end);
    void InsertByIndex(int index, const char *str);
    void InsertByIndex(int index, const StdMyString &str);

    operator int();
    operator float();

    static StdMyString Number(int value);
    static StdMyString Number(float value);

    char &operator[](int index);
    char At(int index);
    bool Contains(const char *str);
    bool Contains(const StdMyString &str);
    int Find(const char *str);
    int Find(const StdMyString &str);

    void operator+=(const StdMyString &str);
    void operator+=(const char *str);
    StdMyString &operator=(const char *str);
    StdMyString &operator=(const StdMyString &str);
    StdMyString operator+(const char *str);
    StdMyString operator+(const StdMyString &str);
    
};

std::ostream &operator<<(std::ostream &out, const StdMyString &str);
std::istream &operator>>(std::istream &out, StdMyString &str);

#endif